// import { format } from 'echarts';

let ApprovalManagement = {
    path: 'ApprovalManagement',
    name: 'ApprovalManagement',
    component: () =>
        import ('../../../views/Company/ApprovalManagement/AppManger1.vue'),
    children: [{
        //展示页
        path: '',
        name: 'AppManger2',
        component: () =>
            import ('../../../views/Company/ApprovalManagement/AppManger2.vue'),
        beforeEnter: (to, from, next) => {
            console.log(from.name)
                //switch写法
                // switch (from.name) {
                //     case 'CompanyHome':
                //         next();
                //         break;
                //     case 'AppManger2':
                //         next();
                //         break;
                //     case 'Details1':
                //         next();
                //         break;
                //     case 'CheckProcess':
                //         next();
                //         break;
                //     case 'Registration':
                //         next();
                //         break;
                //     case 'Details2':
                //         next();
                //         break;
                //     case 'RegistrationOut':
                //         next();
                //         break;
                //     case 'Registerdetails':
                //         next();
                //         break;
                //     case 'Details3':
                //         next();
                //         break;
                //     case 'Outdetails':
                //         next();
                //         break;
                //     case 'RegistrationIn':
                //         next();
                //         break;
                //     case 'Details4':
                //         next();
                //         break;
                //     case 'SeeChangeRecord':
                //         next();
                //         break;
                //     case 'TalentManagement':
                //         next();
                //         break;
                // case null:
                //     if (sessionStorage.getItem('fName') && sessionStorage.getItem('fName') == 'AppManger2') {
                //         next();
                //     }
                //     break;
                // }
            console.log(from.name)
            if (from.name == 'CompanyHome') {
                next();
            } else if (from.name == 'Details1') {
                next();
            } else if (from.name == 'Registration') {
                next();
            } else if (from.name == 'Details2') {
                next();
            } else if (from.name == 'MigrationOut') {
                next();
            } else if (from.name == 'Details3') {
                next();
            } else if (from.name == 'MigrationIn') {
                next();
            } else if (from.name == 'Details4') {
                next();
            } else if (from.name == 'Talentmanger2') {
                next();
            } else if (from.name == 'ReportForm') {
                next();
            } else if (from.name == 'Through') {
                next();
            } else if (from.name == 'SystemManagement') {
                next();
            } else if (from.name == 'Rolemanagement') {
                next();
            } else if (from.name == 'CheckProcess') {
                next();
            } else if (from.name == 'Registerdetails') {
                next();
            } else if (from.name == 'Outdetails') {
                next();
            } else if (from.name == 'SeeChangeRecord') {
                next();
            } else if (sessionStorage.getItem('fName') && sessionStorage.getItem('fName') == 'AppManger2') {
                next();
            }
        },
    }, {
        //展示页详情
        path: '/ApprovalManagement/Details1',
        name: 'Details1',
        component: () =>
            import ('../../../views/Company/ApprovalManagement/Details1.vue'),
        beforeEnter: (to, from, next) => {
            console.log(from.name);
            if (from.name == 'CompanyHome') {
                next();
            } else if (from.name == 'AppManger2') {
                next();
            } else if (from.name == 'Registration') {
                next();
            } else if (from.name == 'Details2') {
                next();
            } else if (from.name == 'MigrationOut') {
                next();
            } else if (from.name == 'Details3') {
                next();
            } else if (from.name == 'MigrationIn') {
                next();
            } else if (from.name == 'Details4') {
                next();
            } else if (from.name == 'Talentmanger2') {
                next();
            } else if (from.name == 'ReportForm') {
                next();
            } else if (from.name == 'Through') {
                next();
            } else if (from.name == 'SystemManagement') {
                next();
            } else if (from.name == 'Rolemanagement') {
                next();
            } else if (from.name == null) {
                console.log(2222);
                if (sessionStorage.getItem('fName') && sessionStorage.getItem('fName') == 'Details1') {
                    next();
                }
            }
        },
        children: [{
            path: '',
            name: 'CheckProcess',
            component: () =>
                import ('../../../views/Personal/PersonalInformation/JobTitle/CheckProcess.vue'),
        }]
    }, {
        //专技人才注册
        path: '/ApprovalManagement/Registration',
        name: 'Registration',
        component: () =>
            import ('../../../views/Company/ApprovalManagement/Registration.vue'),
        beforeEnter: (to, from, next) => {
            console.log(from.name)
            if (from.name == 'CompanyHome') {
                next();
            } else if (from.name == 'AppManger2') {
                next();
            } else if (from.name == 'Details1') {
                next();
            } else if (from.name == 'Details2') {
                next();
            } else if (from.name == 'MigrationOut') {
                next();
            } else if (from.name == 'Details3') {
                next();
            } else if (from.name == 'MigrationIn') {
                next();
            } else if (from.name == 'Details4') {
                next();
            } else if (from.name == 'Talentmanger2') {
                next();
            } else if (from.name == 'ReportForm') {
                next();
            } else if (from.name == 'Through') {
                next();
            } else if (from.name == 'SystemManagement') {
                next();
            } else if (from.name == 'Rolemanagement') {
                next();
            } else if (from.name == 'CheckProcess') {
                next();
            } else if (from.name == 'Registerdetails') {
                next();
            } else if (from.name == 'Outdetails') {
                next();
            } else if (from.name == 'SeeChangeRecord') {
                next();
            } else if (sessionStorage.getItem('fName') && sessionStorage.getItem('fName') == 'Registration') {
                next();
            }
        }
    }, {
        //专技人才注册详情
        path: '/ApprovalManagement/Details2',
        name: 'Details2',
        component: () =>
            import ('../../../views/Company/ApprovalManagement/Details2.vue'),
        beforeEnter: (to, from, next) => {
            console.log(from.name)
            if (from.name == 'CompanyHome') {
                next();
            } else if (from.name == 'AppManger2') {
                next();
            } else if (from.name == 'Details1') {
                next();
            } else if (from.name == 'Registration') {
                next();
            } else if (from.name == 'MigrationOut') {
                next();
            } else if (from.name == 'Details3') {
                next();
            } else if (from.name == 'MigrationIn') {
                next();
            } else if (from.name == 'Details4') {
                next();
            } else if (from.name == 'Talentmanger2') {
                next();
            } else if (from.name == 'ReportForm') {
                next();
            } else if (from.name == 'Through') {
                next();
            } else if (from.name == 'SystemManagement') {
                next();
            } else if (from.name == 'Rolemanagement') {
                next();
            } else if (from.name == 'CheckProcess') {
                next();
            } else if (from.name == 'Registerdetails') {
                next();
            } else if (from.name == 'Outdetails') {
                next();
            } else if (from.name == 'SeeChangeRecord') {
                next();
            } else if (sessionStorage.getItem('fName') && sessionStorage.getItem('fName') == 'Details2') {
                next();
            }
        },
        children: [{
            path: '',
            name: 'Registerdetails',
            component: () =>
                import ('../../../views/Company/ApprovalManagement/Registerdetails.vue')
        }]

    }, {
        //专技人才迁出
        path: '/ApprovalManagement/MigrationOut',
        name: 'MigrationOut',
        component: () =>
            import ('../../../views/Company/ApprovalManagement/MigrationOut.vue'),
        beforeEnter: (to, from, next) => {
            console.log(from.name)
            if (from.name == 'CompanyHome') {
                next();
            } else if (from.name == 'AppManger2') {
                next();
            } else if (from.name == 'Details1') {
                next();
            } else if (from.name == 'Registration') {
                next();
            } else if (from.name == 'Details2') {
                next();
            } else if (from.name == 'Details3') {
                next();
            } else if (from.name == 'MigrationIn') {
                next();
            } else if (from.name == 'Details4') {
                next();
            } else if (from.name == 'Talentmanger2') {
                next();
            } else if (from.name == 'ReportForm') {
                next();
            } else if (from.name == 'Through') {
                next();
            } else if (from.name == 'SystemManagement') {
                next();
            } else if (from.name == 'Rolemanagement') {
                next();
            } else if (from.name == 'CheckProcess') {
                next();
            } else if (from.name == 'Registerdetails') {
                next();
            } else if (from.name == 'Outdetails') {
                next();
            } else if (from.name == 'SeeChangeRecord') {
                next();
            } else if (sessionStorage.getItem('fName') && sessionStorage.getItem('fName') == 'MigrationOut') {
                next();
            }
        },
    }, {
        //专技人才迁出详情
        path: '/ApprovalManagement/Details3',
        name: 'Details3',
        component: () =>
            import ('../../../views/Company/ApprovalManagement/Details3.vue'),
        beforeEnter: (to, from, next) => {
            console.log(from.name)
            if (from.name == 'CompanyHome') {
                next();
            } else if (from.name == 'AppManger2') {
                next();
            } else if (from.name == 'Details1') {
                next();
            } else if (from.name == 'Registration') {
                next();
            } else if (from.name == 'Details2') {
                next();
            } else if (from.name == 'MigrationOut') {
                next();
            } else if (from.name == 'MigrationIn') {
                next();
            } else if (from.name == 'Details4') {
                next();
            } else if (from.name == 'Talentmanger2') {
                next();
            } else if (from.name == 'ReportForm') {
                next();
            } else if (from.name == 'Through') {
                next();
            } else if (from.name == 'SystemManagement') {
                next();
            } else if (from.name == 'Rolemanagement') {
                next();
            } else if (from.name == 'CheckProcess') {
                next();
            } else if (from.name == 'Registerdetails') {
                next();
            } else if (from.name == 'Outdetails') {
                next();
            } else if (from.name == 'SeeChangeRecord') {
                next();
            } else if (sessionStorage.getItem('fName') && sessionStorage.getItem('fName') == 'Details3') {
                next();
            }
        },
        children: [{
            path: '',
            name: 'Outdetails',
            component: () =>
                import ('../../../views/Company/ApprovalManagement/Outdetails.vue')
        }]
    }, {
        //专技人才迁入
        path: '/ApprovalManagement/MigrationIn',
        name: 'MigrationIn',
        component: () =>
            import ('../../../views/Company/ApprovalManagement/MigrationIn.vue'),
        beforeEnter: (to, from, next) => {
            console.log(from.name)
            if (from.name == 'CompanyHome') {
                next();
            } else if (from.name == 'AppManger2') {
                next();
            } else if (from.name == 'Details1') {
                next();
            } else if (from.name == 'Registration') {
                next();
            } else if (from.name == 'Details2') {
                next();
            } else if (from.name == 'MigrationOut') {
                next();
            } else if (from.name == 'Details3') {
                next();
            } else if (from.name == 'Details4') {
                next();
            } else if (from.name == 'Talentmanger2') {
                next();
            } else if (from.name == 'ReportForm') {
                next();
            } else if (from.name == 'Through') {
                next();
            } else if (from.name == 'SystemManagement') {
                next();
            } else if (from.name == 'Rolemanagement') {
                next();
            } else if (from.name == 'CheckProcess') {
                next();
            } else if (from.name == 'Registerdetails') {
                next();
            } else if (from.name == 'Outdetails') {
                next();
            } else if (from.name == 'SeeChangeRecord') {
                next();
            } else if (sessionStorage.getItem('fName') && sessionStorage.getItem('fName') == 'MigrationIn') {
                next();
            }
        },
    }, {
        //专技人才迁入详情
        path: '/ApprovalManagement/Details4',
        name: 'Details4',
        component: () =>
            import ('../../../views/Company/ApprovalManagement/Details4.vue'),
        beforeEnter: (to, from, next) => {
            console.log(from.name)
            if (from.name == 'CompanyHome') {
                next();
            } else if (from.name == 'AppManger2') {
                next();
            } else if (from.name == 'Details1') {
                next();
            } else if (from.name == 'Registration') {
                next();
            } else if (from.name == 'Details2') {
                next();
            } else if (from.name == 'MigrationOut') {
                next();
            } else if (from.name == 'Details3') {
                next();
            } else if (from.name == 'MigrationIn') {
                next();
            } else if (from.name == 'Talentmanger2') {
                next();
            } else if (from.name == 'ReportForm') {
                next();
            } else if (from.name == 'Through') {
                next();
            } else if (from.name == 'SystemManagement') {
                next();
            } else if (from.name == 'Rolemanagement') {
                next();
            } else if (from.name == 'CheckProcess') {
                next();
            } else if (from.name == 'Registerdetails') {
                next();
            } else if (from.name == 'Outdetails') {
                next();
            } else if (from.name == 'SeeChangeRecord') {
                next();
            } else if (sessionStorage.getItem('fName') && sessionStorage.getItem('fName') == 'Details4') {
                next();
            }
        },
        children: [{
            path: '',
            name: 'SeeChangeRecord',
            component: () =>
                import ('../../../views/Personal/PersonalInformation/SeeChangeRecord.vue')
        }]
    }, ]
}
export default ApprovalManagement